package com.KKd.service;

import com.KKd.mapper.CommentMapper;
import com.KKd.pojo.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 14587
 * @date 2020/11/11 0:17
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    public void setCommentMapper(CommentMapper commentMapper) {
        this.commentMapper = commentMapper;
    }

    public int addComment(Comment comm) {
        return commentMapper.addComment(comm);
    }

    public int deleteCommentById(int commId) {
        return commentMapper.deleteCommentById(commId);
    }

    public int addCommThumbNum(int commId) {
        return commentMapper.addCommThumbNum(commId);
    }

    public int decCommThumbNum(int commId) {
        return commentMapper.decCommThumbNum(commId);
    }

    public int setCommentFirstById(int commId) {
        return commentMapper.setCommentFirstById(commId);
    }

    public List<Comment> queryComments(int blogId) {
        return commentMapper.queryComments(blogId);
    }
}
